-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add email notification of BSA job status #2368
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 10 of 10 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @sarahcaseybot and @weiminyu)
core/src/main/java/google/registry/bsa/BsaEmailSender.java
line 24 at r1 (raw file):
/** Sends BSA-related email notifications. */ class BsaEmailSender {
I wonder if it is worth it to have a sender class just as a simple wrapper around GmailClient
. It seems you could just easily inject the GmailClient
and the recipient address at sites where you need to send emails. Why bother with another layer of indirection where potential bugs could be introduced (and needs to be separately tested)?
core/src/main/java/google/registry/bsa/UploadBsaUnavailableDomainsAction.java
line 129 at r1 (raw file):
boolean isGcsSuccess = uploadToGcs(unavailableDomains, runTime); boolean isBsaSuccess = uploadToBsa(unavailableDomains, runTime); if (isBsaSuccess && isGcsSuccess) {
In general, do we want to send emails for successful conditions? Wouldn't that result in a lot of emails that people just ignore and in the end may cause actual failure emails to be missed as well?
core/src/test/java/google/registry/bsa/UploadBsaUnavailableDomainsActionTest.java
line 108 at r1 (raw file):
assertThat(blockList).doesNotContain("not-blocked.tld"); // This test currently fails in the upload-to-bsa step.
I don't understand what this means. Should it fail in some other steps? What is expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @jianglai and @sarahcaseybot)
core/src/main/java/google/registry/bsa/BsaEmailSender.java
line 24 at r1 (raw file):
Previously, jianglai (Lai Jiang) wrote…
I wonder if it is worth it to have a sender class just as a simple wrapper around
GmailClient
. It seems you could just easily inject theGmailClient
and the recipient address at sites where you need to send emails. Why bother with another layer of indirection where potential bugs could be introduced (and needs to be separately tested)?
A sender class can serve two purposes:
- It manages the recipient addresses so that the caller doesn't have to worry about. Granted, we have only one recipient right now but it doesn't hurt.
- It can decorate the message body with action-wide boiler-plates.
It's a bit easier to write tests too, without having to create EmailMessage
in every test.
The GmailClient code path is covered in some tests.
core/src/main/java/google/registry/bsa/UploadBsaUnavailableDomainsAction.java
line 129 at r1 (raw file):
Previously, jianglai (Lai Jiang) wrote…
In general, do we want to send emails for successful conditions? Wouldn't that result in a lot of emails that people just ignore and in the end may cause actual failure emails to be missed as well?
I think yes. We want to know they have run, at least initially.
People can also filter out the successful notifications easily.
core/src/test/java/google/registry/bsa/UploadBsaUnavailableDomainsActionTest.java
line 108 at r1 (raw file):
Previously, jianglai (Lai Jiang) wrote…
I don't understand what this means. Should it fail in some other steps? What is expected?
Ben needs to fix the test. See todo below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @sarahcaseybot)
This change is